package com.translate;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Administrator
 */

public class RowReader implements IRowReader {

    /**
     * 业务逻辑实现方法
     * com.eprosun.util.excel.IRowReader#getRows(int, int, java.util.List)
     *
     * @param sheetIndex ""
     * @param curRow     ""
     * @param rowlist    ""
     * @param batchId    ""
     * @return ""
     */
    @Override
    public List<String> getRows(int sheetIndex, int curRow, List<String> rowlist, String batchId) {
        boolean b = false;
        for (String str : rowlist) {
            if (!org.springframework.util.StringUtils.isEmpty(str)) {
                b = true;
            }
        }
        if (b){
            ExcelDataContext.addList(batchId, rowlist.stream().collect(Collectors.toList()));
            if (curRow == 0 || curRow == 1) {
                ExcelDataContext.putList(batchId, rowlist);
            }
        }
        return rowlist;
    }
}
